//
//  UIBarButtonItem+Extension.swift
//  WeiBo
//
//  Created by Tony on 2017/12/29.
//  Copyright © 2017年 Tony. All rights reserved.
//

import UIKit

extension UIBarButtonItem {
    
    convenience init(imageName: String) {
        
        /*
        self.init()
        let btn = UIButton()
        btn.setImage(UIImage.init(named: imageName), for: .normal)
        btn.setImage(UIImage.init(named: imageName + "_highlighted"), for: .highlighted)
        btn.sizeToFit();
        self.customView = btn;
        */
        
        let btn = UIButton()
        
        btn.setImage(UIImage.init(named: imageName), for: .normal)
        btn.setImage(UIImage.init(named: imageName + "_highlighted"), for: .highlighted)
        btn.sizeToFit();
        
        self.init(customView: btn)
        
    }
}
